package com.unicom.wostore.dsp.dao.imp;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;

/**
 * Created by Huangjie on 2017/2/20.
 */
public abstract class GeneralDaoMybatis extends SqlSessionDaoSupport{

    @Autowired
    @Qualifier("dbTemplate")
    public SqlSession dbTemplate;

    @Autowired(required = false)
    @Primary
    public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory){
        super.setSqlSessionFactory(sqlSessionFactory);
    }

    @Autowired(required = false)
    @Primary
    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
        super.setSqlSessionTemplate(sqlSessionTemplate);
    }
}
